package aop.spring;
public interface Lockable {
    void lock();
    void unlock();
    boolean locked();
}

package aop.spring;
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
public class LockMixin extends DelegatingIntroductionInterceptor
                       implements Lockable {
    private boolean locked;
    public void lock() {
        this.locked = true;
		}
    public void unlock() {
        this.locked = false;
    }
    public boolean locked() {
        return this.locked;
    }
    public Object invoke(MethodInvocation invocation) throws Throwable {
        if (locked() && invocation.getMethod().getName().indexOf("set") == 0)
            throw new LockedException();
        return super.invoke(invocation);
    }
}

package aop.spring;
import org.springframework.aop.support.DefaultIntroductionAdvisor;
public class LockMixinAdvisor extends DefaultIntroductionAdvisor {
    public LockMixinAdvisor() {
        super(new LockMixin(), Lockable.class);
    }
    // we only apply the lock mix-in to the Order class
    public boolean matches(Class clazz) {
        return clazz.getName().equals("aop.spring.Order");
    }
}
<bean id="lockAdvisor" class="aop.spring.LockMixinAdvisor"/>